<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
  import {
    setToken,
    getToken
  } from '@/utils/auth'
  export default {
    name: 'App',
    data() {
      return {
        tokenId: ''
      }
    },
    mounted() {
      // 接受vue传过来的值
      window.addEventListener('message', event => {


       if (event.data &&  typeof event.data === 'string') {
           try {
             const data = JSON.parse(event.data)
            
             if (data.username && data.password) {
              this.$store.dispatch('user/setIframeInfo',data)
             }
           } catch (e) {
             console.error(e)
           }
         }
      }, false)
    }

  }
</script>
<style>
  * {
    font-family: '微软雅黑';
    user-select: none;
  }

  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  img {
    vertical-align: middle;
  }
</style>
